
<template>
  <s-table
    class="h100"
    :columns="columns"
    :data-source="tbData"
    rowKey="id"
    ref="table"
    :scrollX="800"
    :showFilter="false"
  >
    <template
      slot-scope="text"
      v-for="column in commonColumns"
      :slot="column.scopedSlots.customRender"
    >
      <table-ellipsis :text="text || '-'" :key="column.key"></table-ellipsis>
    </template>
    <template #installStatus="text">{{ $t(getEcuAssembleTypeOptionsObj[text]) || '-' }}</template>
  </s-table>
</template>
<script>
import { relatedModelTbColumns } from '../config/list'
import TableEllipsis from '@/components/Ellipsis/TableEllipsis'
import { STable } from '@/components'
export default {
  props: {
    tbData: {
      type: Array,
      default () {
        return []
      }
    }
  },
  components: {
    TableEllipsis,
    STable
  },
  computed: {
    commonColumns () {
      return relatedModelTbColumns.filter(item => !item.special)
    },
    getEcuAssembleTypeOptionsObj () {
      return this.$store.getters.getDictCodeObj('ecuAssembleTypeOptions')
    }
  },
  data () {
    return {
      columns: relatedModelTbColumns
    }
  },
  methods: {
  }
}
</script>
<style lang="less" scoped></style>
